using NoteManger.Properties;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace NoteManger
{
	public class FrmNewUser : TemplateForm
	{
		private IContainer components = null;
		private GroupBox groupBox;
		private Button btnCancel;
		private Button btnNewUser;
		private Label label6;
		private ComboBox cbbDep;
		private Label label5;
		private ComboBox cbbUserGroup;
		private PictureBox pboxPassword;
		private PictureBox pboxUser;
		private TextBox tboxPwdCheck;
		private Label label4;
		private TextBox tboxPwd;
		private Label label3;
		private TextBox tboxUserName;
		private Label label2;
		private TextBox tboxUserID;
		private Label label1;
		private GroupBox gboxsplit;
		private PictureBox pboxDep;
		private ToolTip toolTip;
		private GroupBox groupBox1;
		private TextBox tboxemail;
		private Label label7;
		private Label label8;
		private ComboBox cbbSex;
		private Label label9;
		private TextBox tboxMsn;
		private Label label11;
		private TextBox tboxPhone;
		private Label label10;
		private TextBox tboxExPhone;
		private Label label13;
		private TextBox tboxQq;
		private Label label12;
		private Button btnHelp;
		private string[,] aDepartmentList = new string[0, 0];
		private string[,] aGroupList = new string[0, 0];
		private NoteRemote _NoteRemoteObject = null;
		public NoteRemote NoteRemoteObject
		{
			set
			{
				this._NoteRemoteObject = value;
				if (this._NoteRemoteObject != null)
				{
					try
					{
						if (!this._NoteRemoteObject.ConnectionTest())
						{
							MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							return;
						}
					}
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						return;
					}
					string text = "";
					bool flag = false;
					try
					{
						flag = this._NoteRemoteObject.GetDepartmentList(ref this.aDepartmentList, ref text);
					}
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
					if (flag)
					{
						int num = this.aDepartmentList.GetUpperBound(0) - this.aDepartmentList.GetLowerBound(0) + 1;
						int num2 = this.aDepartmentList.GetUpperBound(1) - this.aDepartmentList.GetLowerBound(1) + 1;
						for (int i = 0; i <= num - 1; i++)
						{
							this.cbbDep.Items.Add(this.aDepartmentList[i, 1]);
						}
					}
					else
					{
						MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
				}
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			this.groupBox = new GroupBox();
			this.tboxExPhone = new TextBox();
			this.label13 = new Label();
			this.tboxQq = new TextBox();
			this.label12 = new Label();
			this.tboxMsn = new TextBox();
			this.label11 = new Label();
			this.tboxPhone = new TextBox();
			this.label10 = new Label();
			this.cbbSex = new ComboBox();
			this.label9 = new Label();
			this.label8 = new Label();
			this.tboxemail = new TextBox();
			this.label7 = new Label();
			this.groupBox1 = new GroupBox();
			this.pboxDep = new PictureBox();
			this.gboxsplit = new GroupBox();
			this.btnCancel = new Button();
			this.btnNewUser = new Button();
			this.label6 = new Label();
			this.cbbDep = new ComboBox();
			this.label5 = new Label();
			this.cbbUserGroup = new ComboBox();
			this.pboxPassword = new PictureBox();
			this.pboxUser = new PictureBox();
			this.tboxPwdCheck = new TextBox();
			this.label4 = new Label();
			this.tboxPwd = new TextBox();
			this.label3 = new Label();
			this.tboxUserName = new TextBox();
			this.label2 = new Label();
			this.tboxUserID = new TextBox();
			this.label1 = new Label();
			this.toolTip = new ToolTip(this.components);
			this.btnHelp = new Button();
			this.groupBox.SuspendLayout();
			((ISupportInitialize)this.pboxDep).BeginInit();
			((ISupportInitialize)this.pboxPassword).BeginInit();
			((ISupportInitialize)this.pboxUser).BeginInit();
			base.SuspendLayout();
			this.groupBox.BackColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.groupBox.Controls.Add(this.btnHelp);
			this.groupBox.Controls.Add(this.tboxExPhone);
			this.groupBox.Controls.Add(this.label13);
			this.groupBox.Controls.Add(this.tboxQq);
			this.groupBox.Controls.Add(this.label12);
			this.groupBox.Controls.Add(this.tboxMsn);
			this.groupBox.Controls.Add(this.label11);
			this.groupBox.Controls.Add(this.tboxPhone);
			this.groupBox.Controls.Add(this.label10);
			this.groupBox.Controls.Add(this.cbbSex);
			this.groupBox.Controls.Add(this.label9);
			this.groupBox.Controls.Add(this.label8);
			this.groupBox.Controls.Add(this.tboxemail);
			this.groupBox.Controls.Add(this.label7);
			this.groupBox.Controls.Add(this.groupBox1);
			this.groupBox.Controls.Add(this.pboxDep);
			this.groupBox.Controls.Add(this.gboxsplit);
			this.groupBox.Controls.Add(this.btnCancel);
			this.groupBox.Controls.Add(this.btnNewUser);
			this.groupBox.Controls.Add(this.label6);
			this.groupBox.Controls.Add(this.cbbDep);
			this.groupBox.Controls.Add(this.label5);
			this.groupBox.Controls.Add(this.cbbUserGroup);
			this.groupBox.Controls.Add(this.pboxPassword);
			this.groupBox.Controls.Add(this.pboxUser);
			this.groupBox.Controls.Add(this.tboxPwdCheck);
			this.groupBox.Controls.Add(this.label4);
			this.groupBox.Controls.Add(this.tboxPwd);
			this.groupBox.Controls.Add(this.label3);
			this.groupBox.Controls.Add(this.tboxUserName);
			this.groupBox.Controls.Add(this.label2);
			this.groupBox.Controls.Add(this.tboxUserID);
			this.groupBox.Controls.Add(this.label1);
			this.groupBox.Font = new System.Drawing.Font("宋体", 11f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.groupBox.ForeColor = System.Drawing.Color.White;
			this.groupBox.Location = new System.Drawing.Point(12, 21);
			this.groupBox.Name = "groupBox";
			this.groupBox.Size = new System.Drawing.Size(497, 461);
			this.groupBox.TabIndex = 17;
			this.groupBox.TabStop = false;
			this.groupBox.Text = "注册新用户";
			this.tboxExPhone.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxExPhone.Location = new System.Drawing.Point(337, 334);
			this.tboxExPhone.Name = "tboxExPhone";
			this.tboxExPhone.Size = new System.Drawing.Size(132, 21);
			this.tboxExPhone.TabIndex = 48;
			this.label13.AutoSize = true;
			this.label13.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label13.ForeColor = System.Drawing.Color.White;
			this.label13.Location = new System.Drawing.Point(303, 337);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(35, 14);
			this.label13.TabIndex = 49;
			this.label13.Text = "分机";
			this.tboxQq.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxQq.Location = new System.Drawing.Point(146, 377);
			this.tboxQq.Name = "tboxQq";
			this.tboxQq.Size = new System.Drawing.Size(152, 21);
			this.tboxQq.TabIndex = 46;
			this.label12.AutoSize = true;
			this.label12.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label12.ForeColor = System.Drawing.Color.White;
			this.label12.Location = new System.Drawing.Point(77, 380);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(21, 14);
			this.label12.TabIndex = 47;
			this.label12.Text = "QQ";
			this.tboxMsn.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxMsn.Location = new System.Drawing.Point(337, 376);
			this.tboxMsn.Name = "tboxMsn";
			this.tboxMsn.Size = new System.Drawing.Size(132, 21);
			this.tboxMsn.TabIndex = 44;
			this.label11.AutoSize = true;
			this.label11.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label11.ForeColor = System.Drawing.Color.White;
			this.label11.Location = new System.Drawing.Point(303, 379);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(28, 14);
			this.label11.TabIndex = 45;
			this.label11.Text = "MSN";
			this.tboxPhone.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxPhone.Location = new System.Drawing.Point(146, 335);
			this.tboxPhone.Name = "tboxPhone";
			this.tboxPhone.Size = new System.Drawing.Size(152, 21);
			this.tboxPhone.TabIndex = 42;
			this.label10.AutoSize = true;
			this.label10.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label10.ForeColor = System.Drawing.Color.White;
			this.label10.Location = new System.Drawing.Point(77, 338);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(63, 14);
			this.label10.TabIndex = 43;
			this.label10.Text = "手机号码";
			this.cbbSex.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbSex.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.cbbSex.FormattingEnabled = true;
			this.cbbSex.Items.AddRange(new object[]
			{
				"男",
				"女"
			});
			this.cbbSex.Location = new System.Drawing.Point(372, 292);
			this.cbbSex.Name = "cbbSex";
			this.cbbSex.Size = new System.Drawing.Size(97, 22);
			this.cbbSex.TabIndex = 41;
			this.label9.AutoSize = true;
			this.label9.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label9.ForeColor = System.Drawing.Color.White;
			this.label9.Location = new System.Drawing.Point(331, 297);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(35, 14);
			this.label9.TabIndex = 40;
			this.label9.Text = "性别";
			this.label8.AutoSize = true;
			this.label8.Font = new System.Drawing.Font("宋体", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label8.ForeColor = System.Drawing.Color.White;
			this.label8.Location = new System.Drawing.Point(187, 294);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(128, 16);
			this.label8.TabIndex = 39;
			this.label8.Text = "@winning.com.cn";
			this.tboxemail.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxemail.Location = new System.Drawing.Point(146, 293);
			this.tboxemail.Name = "tboxemail";
			this.tboxemail.Size = new System.Drawing.Size(38, 21);
			this.tboxemail.TabIndex = 37;
			this.label7.AutoSize = true;
			this.label7.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label7.ForeColor = System.Drawing.Color.White;
			this.label7.Location = new System.Drawing.Point(78, 296);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(63, 14);
			this.label7.TabIndex = 38;
			this.label7.Text = "邮箱地址";
			this.groupBox1.Location = new System.Drawing.Point(6, 271);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(488, 9);
			this.groupBox1.TabIndex = 36;
			this.groupBox1.TabStop = false;
			this.pboxDep.Location = new System.Drawing.Point(17, 217);
			this.pboxDep.Name = "pboxDep";
			this.pboxDep.Size = new System.Drawing.Size(48, 48);
			this.pboxDep.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxDep.TabIndex = 35;
			this.pboxDep.TabStop = false;
			this.gboxsplit.Location = new System.Drawing.Point(6, 404);
			this.gboxsplit.Name = "gboxsplit";
			this.gboxsplit.Size = new System.Drawing.Size(488, 9);
			this.gboxsplit.TabIndex = 34;
			this.gboxsplit.TabStop = false;
			this.btnCancel.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
			this.btnCancel.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.btnCancel.ForeColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.btnCancel.Location = new System.Drawing.Point(377, 426);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(92, 26);
			this.btnCancel.TabIndex = 7;
			this.btnCancel.Text = "取消";
			this.btnCancel.UseVisualStyleBackColor = false;
			this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
			this.btnNewUser.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
			this.btnNewUser.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.btnNewUser.ForeColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.btnNewUser.Location = new System.Drawing.Point(267, 426);
			this.btnNewUser.Name = "btnNewUser";
			this.btnNewUser.Size = new System.Drawing.Size(99, 26);
			this.btnNewUser.TabIndex = 6;
			this.btnNewUser.Text = "注册(&R)";
			this.btnNewUser.UseVisualStyleBackColor = false;
			this.btnNewUser.Click += new EventHandler(this.btnNewUser_Click);
			this.label6.AutoSize = true;
			this.label6.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label6.ForeColor = System.Drawing.Color.White;
			this.label6.Location = new System.Drawing.Point(78, 235);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(63, 14);
			this.label6.TabIndex = 30;
			this.label6.Text = "部    门";
			this.cbbDep.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbDep.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.cbbDep.FormattingEnabled = true;
			this.cbbDep.Location = new System.Drawing.Point(146, 232);
			this.cbbDep.Name = "cbbDep";
			this.cbbDep.Size = new System.Drawing.Size(152, 22);
			this.cbbDep.TabIndex = 4;
			this.toolTip.SetToolTip(this.cbbDep, "选择你所在的部门名称，然后选择一个工作组！");
			this.cbbDep.SelectedIndexChanged += new EventHandler(this.cbbDep_SelectedIndexChanged);
			this.cbbDep.KeyPress += new KeyPressEventHandler(this.cbbDep_KeyPress);
			this.label5.AutoSize = true;
			this.label5.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label5.ForeColor = System.Drawing.Color.White;
			this.label5.Location = new System.Drawing.Point(304, 237);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(63, 14);
			this.label5.TabIndex = 28;
			this.label5.Text = "用 户 组";
			this.cbbUserGroup.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbUserGroup.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.cbbUserGroup.FormattingEnabled = true;
			this.cbbUserGroup.Location = new System.Drawing.Point(372, 232);
			this.cbbUserGroup.Name = "cbbUserGroup";
			this.cbbUserGroup.Size = new System.Drawing.Size(97, 22);
			this.cbbUserGroup.TabIndex = 5;
			this.cbbUserGroup.KeyPress += new KeyPressEventHandler(this.cbbUserGroup_KeyPress);
			this.pboxPassword.Location = new System.Drawing.Point(16, 130);
			this.pboxPassword.Name = "pboxPassword";
			this.pboxPassword.Size = new System.Drawing.Size(48, 48);
			this.pboxPassword.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxPassword.TabIndex = 26;
			this.pboxPassword.TabStop = false;
			this.pboxUser.InitialImage = null;
			this.pboxUser.Location = new System.Drawing.Point(17, 33);
			this.pboxUser.Name = "pboxUser";
			this.pboxUser.Size = new System.Drawing.Size(48, 48);
			this.pboxUser.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxUser.TabIndex = 25;
			this.pboxUser.TabStop = false;
			this.tboxPwdCheck.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxPwdCheck.Location = new System.Drawing.Point(146, 188);
			this.tboxPwdCheck.Name = "tboxPwdCheck";
			this.tboxPwdCheck.PasswordChar = '☻';
			this.tboxPwdCheck.Size = new System.Drawing.Size(323, 23);
			this.tboxPwdCheck.TabIndex = 3;
			this.tboxPwdCheck.KeyPress += new KeyPressEventHandler(this.tboxPwdCheck_KeyPress);
			this.label4.AutoSize = true;
			this.label4.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label4.ForeColor = System.Drawing.Color.White;
			this.label4.Location = new System.Drawing.Point(77, 191);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(63, 14);
			this.label4.TabIndex = 23;
			this.label4.Text = "再输一次";
			this.tboxPwd.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxPwd.Location = new System.Drawing.Point(146, 142);
			this.tboxPwd.Name = "tboxPwd";
			this.tboxPwd.PasswordChar = '☻';
			this.tboxPwd.Size = new System.Drawing.Size(323, 23);
			this.tboxPwd.TabIndex = 2;
			this.tboxPwd.KeyPress += new KeyPressEventHandler(this.tboxPwd_KeyPress);
			this.label3.AutoSize = true;
			this.label3.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label3.ForeColor = System.Drawing.Color.White;
			this.label3.Location = new System.Drawing.Point(77, 145);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(63, 14);
			this.label3.TabIndex = 21;
			this.label3.Text = "密    码";
			this.tboxUserName.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxUserName.Location = new System.Drawing.Point(146, 95);
			this.tboxUserName.Name = "tboxUserName";
			this.tboxUserName.Size = new System.Drawing.Size(323, 23);
			this.tboxUserName.TabIndex = 1;
			this.toolTip.SetToolTip(this.tboxUserName, "建议使用真实姓名注册！");
			this.tboxUserName.KeyPress += new KeyPressEventHandler(this.tboxUserName_KeyPress);
			this.label2.AutoSize = true;
			this.label2.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label2.ForeColor = System.Drawing.Color.White;
			this.label2.Location = new System.Drawing.Point(77, 98);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(63, 14);
			this.label2.TabIndex = 19;
			this.label2.Text = "用户姓名";
			this.tboxUserID.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.tboxUserID.Location = new System.Drawing.Point(146, 46);
			this.tboxUserID.Name = "tboxUserID";
			this.tboxUserID.Size = new System.Drawing.Size(323, 23);
			this.tboxUserID.TabIndex = 0;
			this.toolTip.SetToolTip(this.tboxUserID, "建议使用工号注册！");
			this.tboxUserID.KeyPress += new KeyPressEventHandler(this.tboxUserID_KeyPress);
			this.label1.AutoSize = true;
			this.label1.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label1.ForeColor = System.Drawing.Color.White;
			this.label1.Location = new System.Drawing.Point(77, 49);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(63, 14);
			this.label1.TabIndex = 17;
			this.label1.Text = "用户编号";
			this.btnHelp.Image = Resources.information_2;
			this.btnHelp.Location = new System.Drawing.Point(17, 426);
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.Size = new System.Drawing.Size(24, 24);
			this.btnHelp.TabIndex = 50;
			this.btnHelp.UseVisualStyleBackColor = true;
			this.btnHelp.Click += new EventHandler(this.btnHelp_Click);
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			this.BackColor = System.Drawing.Color.FromArgb(51, 79, 103);
			base.ClientSize = new System.Drawing.Size(521, 493);
			base.Controls.Add(this.groupBox);
			base.FormBorderStyle = FormBorderStyle.None;
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			base.Name = "FrmNewUser";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "新用户注册";
			this.groupBox.ResumeLayout(false);
			this.groupBox.PerformLayout();
			((ISupportInitialize)this.pboxDep).EndInit();
			((ISupportInitialize)this.pboxPassword).EndInit();
			((ISupportInitialize)this.pboxUser).EndInit();
			base.ResumeLayout(false);
		}
		public FrmNewUser()
		{
			this.InitializeComponent();
			try
			{
				System.Drawing.Image image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\Login.png");
				this.pboxUser.Image = image;
				image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\Key.png");
				this.pboxPassword.Image = image;
				image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\Dep.png");
				this.pboxDep.Image = image;
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void btnNewUser_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			string text = "";
			bool flag = false;
			try
			{
				flag = this._NoteRemoteObject.UserReg(this.tboxUserID.Text.Trim(), this.tboxUserName.Text.Trim(), this.tboxPwd.Text.Trim(), this.tboxPwdCheck.Text.Trim(), this.GetDepID(this.cbbDep.Text), this.GetGroupID(this.cbbUserGroup.Text), ref text);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			if (flag)
			{
				MessageBox.Show("新用户注册成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				string[,] array = new string[0, 0];
				string aStrSql = string.Concat(new string[]
				{
					"exec usp_wn_userexpandinfo '",
					this.tboxUserID.Text.Trim(),
					"','",
					this.tboxemail.Text.Trim(),
					"@winning.com.cn','",
					this.cbbSex.Text,
					"','",
					this.tboxPhone.Text.Trim(),
					"','",
					this.tboxExPhone.Text.Trim(),
					"','",
					this.tboxQq.Text.Trim(),
					"','",
					this.tboxMsn.Text.Trim(),
					"'"
				});
				this._NoteRemoteObject.CommonQuery(aStrSql, ref array, ref text);
				base.DialogResult = DialogResult.OK;
			}
			else
			{
				MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void btnCancel_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Cancel;
		}
		private string GetDepID(string aDepName)
		{
			string result = "";
			int num = this.aDepartmentList.GetUpperBound(0) - this.aDepartmentList.GetLowerBound(0) + 1;
			int num2 = this.aDepartmentList.GetUpperBound(1) - this.aDepartmentList.GetLowerBound(1) + 1;
			for (int i = 0; i <= num - 1; i++)
			{
				if (this.aDepartmentList[i, 1] == aDepName)
				{
					result = this.aDepartmentList[i, 0];
				}
			}
			return result;
		}
		private string GetGroupID(string aGroupName)
		{
			string result = "";
			int num = this.aGroupList.GetUpperBound(0) - this.aGroupList.GetLowerBound(0) + 1;
			int num2 = this.aGroupList.GetUpperBound(1) - this.aGroupList.GetLowerBound(1) + 1;
			for (int i = 0; i <= num - 1; i++)
			{
				if (this.aGroupList[i, 1] == aGroupName)
				{
					result = this.aGroupList[i, 0];
				}
			}
			return result;
		}
		private void cbbDep_SelectedIndexChanged(object sender, EventArgs e)
		{
			string text = "";
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			string depID = this.GetDepID(this.cbbDep.Text);
			this.cbbUserGroup.Items.Clear();
			bool flag = false;
			try
			{
				flag = this._NoteRemoteObject.GetGroupList(depID, ref this.aGroupList, ref text);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			if (flag)
			{
				int num = this.aGroupList.GetUpperBound(0) - this.aGroupList.GetLowerBound(0) + 1;
				int num2 = this.aGroupList.GetUpperBound(1) - this.aGroupList.GetLowerBound(1) + 1;
				for (int i = 0; i <= num - 1; i++)
				{
					this.cbbUserGroup.Items.Add(this.aGroupList[i, 1]);
				}
			}
			else
			{
				MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void tboxUserID_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				if (this.tboxUserName.CanFocus)
				{
					this.tboxUserName.Focus();
				}
				e.Handled = true;
			}
		}
		private void tboxUserName_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				if (this.tboxPwd.CanFocus)
				{
					this.tboxPwd.Focus();
				}
				e.Handled = true;
			}
		}
		private void tboxPwd_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				if (this.tboxPwdCheck.CanFocus)
				{
					this.tboxPwdCheck.Focus();
				}
				e.Handled = true;
			}
		}
		private void tboxPwdCheck_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				if (this.cbbDep.CanFocus)
				{
					this.cbbDep.Focus();
				}
				e.Handled = true;
			}
		}
		private void cbbDep_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				if (this.cbbUserGroup.CanFocus)
				{
					this.cbbUserGroup.Focus();
				}
				e.Handled = true;
			}
		}
		private void cbbUserGroup_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				if (this.btnNewUser.CanFocus)
				{
					this.btnNewUser.Focus();
				}
				e.Handled = true;
			}
		}
		private void btnHelp_Click(object sender, EventArgs e)
		{
			Help.ShowHelp(new Control(), NoteRemote.GetNoteClientStartPath() + "\\日志管理系统帮助文件.chm", "注册新用户.htm");
		}
	}
}
